Merged from maemo-gtk:
authorMichael Natterer <mitch@imendio.com>
Wed, 27 Jun 2007 11:43:16 +0000 (11:43 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Wed, 27 Jun 2007 11:43:16 +0000 (11:43 +0000)
2007-06-27  Michael Natterer  <mitch@imendio.com>

Merged from maemo-gtk:

* gtk/gtkmenu.c (gtk_menu_handle_scrolling): when updating the
scroll arrows' state, make sure we don't overwrite the insensitive
state that might have been set by the first scroll step hitting
the top/bottom border of the menu.

svn path=/trunk/; revision=18260

ChangeLog
gtk/gtkmenu.c

index e0f6efe4806091f7a72d168d9098f77d7bc050f4..25005c70795efad5517aa2aef00dc7f346162c6a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-06-27  Michael Natterer  <mitch@imendio.com>
+
+       Merged from maemo-gtk:
+
+       * gtk/gtkmenu.c (gtk_menu_handle_scrolling): when updating the
+       scroll arrows' state, make sure we don't overwrite the insensitive
+       state that might have been set by the first scroll step hitting
+       the top/bottom border of the menu.
+
 Wed Jun 27 13:27:21 2007  Tim Janik  <timj@gtk.org>
 
        * gtk/gtkradiobutton.[hc]: applied patch to improve variable names, 
@@ -5,7 +14,8 @@ Wed Jun 27 13:27:21 2007  Tim Janik  <timj@gtk.org>
 
 Wed Jun 27 11:57:41 2007  Tim Janik  <timj@imendio.com>
 
-       * gtk/gtkstatusicon.c (gtk_status_icon_position_menu): fixed push_in description.
+       * gtk/gtkstatusicon.c (gtk_status_icon_position_menu): fixed
+       push_in description.
 
 2007-06-27  Johan Dahlin  <jdahlin@async.com.br>
 
index 242488960b7813d25db3baf12139c75f3c3d58a9..66fd3108dfa6d45c100d62e62b4bcd5794e0acbe 100644 (file)
@@ -3273,8 +3273,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
 
   if (priv->upper_arrow_state != GTK_STATE_INSENSITIVE)
     {
-      gboolean     arrow_pressed = FALSE;
-      GtkStateType arrow_state   = GTK_STATE_NORMAL;
+      gboolean arrow_pressed = FALSE;
 
       if (menu->upper_arrow_visible && !menu->tearoff_active)
         {
@@ -3342,17 +3341,26 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
             }
         }
 
-      if (arrow_pressed)
-        arrow_state = GTK_STATE_ACTIVE;
-      else if (menu->upper_arrow_prelight)
-        arrow_state = GTK_STATE_PRELIGHT;
-
-      if (arrow_state != priv->upper_arrow_state)
+      /*  gtk_menu_start_scrolling() might have hit the top of the
+       *  menu, so check if the button isn't insensitive before
+       *  changing it to something else.
+       */
+      if (priv->upper_arrow_state != GTK_STATE_INSENSITIVE)
         {
-          priv->upper_arrow_state = arrow_state;
+          GtkStateType arrow_state = GTK_STATE_NORMAL;
+
+          if (arrow_pressed)
+            arrow_state = GTK_STATE_ACTIVE;
+          else if (menu->upper_arrow_prelight)
+            arrow_state = GTK_STATE_PRELIGHT;
 
-          gdk_window_invalidate_rect (GTK_WIDGET (menu)->window,
-                                      &rect, FALSE);
+          if (arrow_state != priv->upper_arrow_state)
+            {
+              priv->upper_arrow_state = arrow_state;
+
+              gdk_window_invalidate_rect (GTK_WIDGET (menu)->window,
+                                          &rect, FALSE);
+            }
         }
     }
 
@@ -3373,8 +3381,7 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
 
   if (priv->lower_arrow_state != GTK_STATE_INSENSITIVE)
     {
-      gboolean     arrow_pressed = FALSE;
-      GtkStateType arrow_state   = GTK_STATE_NORMAL;
+      gboolean arrow_pressed = FALSE;
 
       if (menu->lower_arrow_visible && !menu->tearoff_active)
         {
@@ -3442,17 +3449,26 @@ gtk_menu_handle_scrolling (GtkMenu *menu,
             }
         }
 
-      if (arrow_pressed)
-        arrow_state = GTK_STATE_ACTIVE;
-      else if (menu->lower_arrow_prelight)
-        arrow_state = GTK_STATE_PRELIGHT;
-
-      if (arrow_state != priv->lower_arrow_state)
+      /*  gtk_menu_start_scrolling() might have hit the bottom of the
+       *  menu, so check if the button isn't insensitive before
+       *  changing it to something else.
+       */
+      if (priv->lower_arrow_state != GTK_STATE_INSENSITIVE)
         {
-          priv->lower_arrow_state = arrow_state;
+          GtkStateType arrow_state = GTK_STATE_NORMAL;
+
+          if (arrow_pressed)
+            arrow_state = GTK_STATE_ACTIVE;
+          else if (menu->lower_arrow_prelight)
+            arrow_state = GTK_STATE_PRELIGHT;
 
-          gdk_window_invalidate_rect (GTK_WIDGET (menu)->window,
-                                      &rect, FALSE);
+          if (arrow_state != priv->lower_arrow_state)
+            {
+              priv->lower_arrow_state = arrow_state;
+
+              gdk_window_invalidate_rect (GTK_WIDGET (menu)->window,
+                                          &rect, FALSE);
+            }
         }
     }
 }